import { http } from '@/utils/http'

/**
 * 添加收货地址 post
 */
export const postMemberAddressAPI = (data: any) => {
  return http({
    method: 'POST',
    url: '/member/address',
    data,
  })
}

// 获取收货地址 get
export const getMemberAddressAPI = () =>{
  return http({
    method: 'GET',
    url: '/member/address',
  })
}

// 数据回显
export const getMemberAddressByIdAPI = (id:string) =>{
  return http({
    method: 'GET',
    url: `/member/address/${id}`,
  })
}

// 更新地址
export const putMemberAddressByIdAPI = (id: string, data: any) =>{
  return http({
    method:'PUT',
    url:`/member/address/${id}`,
    data
  })
}

// 删除地址
export const deleteMemberAddressByIdAPI = (id:string) =>{
  return http({
    method:"DELETE",
    url:`/member/address/${id}`
  })
}